package com.grade.system.service.impl;

import com.grade.common.core.text.Convert;
import com.grade.common.utils.DateUtils;
import com.grade.system.domain.CreditGradeType;
import com.grade.system.domain.GradeItem;
import com.grade.system.domain.GradeType;
import com.grade.system.mapper.GradeItemMapper;
import com.grade.system.mapper.CreditGradeTypeMapper;
import com.grade.system.service.ICreditGradeTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 预评分分类Service业务层处理
 * 
 * @author gaojh
 * @date 2021-11-12
 */
@Service
public class CreditGradeTypeServiceImpl implements ICreditGradeTypeService
{
    @Autowired
    private CreditGradeTypeMapper creditGradeTypeMapper;

    /**
     * 新增评分标准分类
     * 
     * @param gradeType 评分标准分类
     * @return 结果
     */
    @Override
    public int insertGradeType(CreditGradeType creditGradeType)
    {
        creditGradeType.setCreateTime(DateUtils.getNowDate());
        return creditGradeTypeMapper.insertCreditGradeType(creditGradeType);
    }

    /**
     * 删除评分标准分类信息
     * 
     * @param gradeId 预评分ID
     * @return 结果
     */
    @Override
    public int deleteCreditGradeTypeByGradeId(Long gradeId)
    {
        return creditGradeTypeMapper.deleteCreditGradeTypeByGradeId(gradeId);
    }

    @Override
    public List<CreditGradeType> selectCreditGradeTypeParentList(CreditGradeType creditGradeType) {
        return creditGradeTypeMapper.selectCreditGradeTypeParentList(creditGradeType);
    }
}
